

public class Convoi {
	public Convoi(Vehicule[] v) {
		vehicules = v;
	}
	
	private Vehicule[] vehicules;
	
	public float vitesseConvoi() {
		float vit = 1000;
		
		for(Vehicule v : vehicules)
		{
			if(v.vitesse() < vit)
			{
				vit = v.vitesse();
			}
		}
		
		return vit;
	}
	
	public float consoConvoi() {
		float c = 0;
		
		for(Vehicule v : vehicules)
		{
			c += v.conso();
		}
		
		return c;
	}
	
	public String toString() {
		String s = "Convoie : \n";
		
		for(Vehicule v : vehicules)
		{
			s += "\t"+v+"\n";
		}

		s += "\n\t\tVitesse Max. : "+vitesseConvoi();
		s += "\n\t\tConsommation : "+consoConvoi();
		
		return s;
	}
}
